﻿using System;
using System.Collections;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using WCF = System.Web.Configuration.WebConfigurationManager;

/// <summary>
/// Summary description for DauGia_Info
/// </summary>
public class DauGia_Data
{
    
    public SqlDataAdapter gets_DauGia(int MaSanPhamDauGia)
    {
        string connectionString = WCF.ConnectionStrings["gets_SPDG"].ConnectionString;
        SqlConnection connection = new SqlConnection(connectionString);
        if (connection.State == ConnectionState.Open)
            connection.Close();
        connection.Open();
        SqlDataAdapter Adapter = new SqlDataAdapter();
        try
        {
            SqlCommand Command = new SqlCommand();
            Command.CommandText = "gets_DauGia";
            Command.Connection = connection;
            Command.CommandType = CommandType.StoredProcedure;
            Command.Parameters.AddWithValue("@MaSanPhamDauGia",MaSanPhamDauGia);
            Adapter.SelectCommand = Command;
        }
        catch (Exception ex)
        {
            throw new Exception(ex.Message);
        }
        return Adapter;
    }
}
